import java.io.File
import java.io.FileOutputStream
import java.util.zip.CRC32
import java.util.zip.CheckedOutputStream
import java.util.zip.ZipOutputStream

fun main(args: Array<String>) {
    val destFile = File("/Users/zhangweihua/IdeaProjects/woyun/trunk/woyun.zip")
    val cos = CheckedOutputStream(FileOutputStream(destFile), CRC32())
    val zos = ZipOutputStream(cos)
    val srcFile = File("/Users/zhangweihua/IdeaProjects/woyun/trunk/woyun")
    if (srcFile.isDirectory) {
        srcFile.listFiles().forEach {
            ZipUtils.compress(it, zos, "")
        }
    }
    zos.close()
    cos.close()
}
